﻿package 
{
	import flash.display.MovieClip;
	import flash.geom.ColorTransform;
	import flash.events.MouseEvent;
	import flash.events.Event;
	import flash.ui.Mouse;
	

	/**
	 * ...
	 * @author Jonghwa Kim
	 */
	public class BlockPoint extends MovieClip{
		
		
		public function BlockPoint(_num:Number = 0, _color:int = 0) {
			
			this.mouseEnabled = false;
			
			var cTrans:ColorTransform;
			
			
			switch(_color){
				case 0:	//B	
				cTrans = new ColorTransform(0.08, 0.54, 1, 1, 0, 0, 0, 0);
				break;
				case 1:	//G
				cTrans = new ColorTransform(0.54, 0.98, 0.2, 1, 0, 0, 0, 0);
				break;
				case 2:	//R
				cTrans = new ColorTransform(1, 0, 0.36, 1, 0, 0, 0, 0);
				break;
				case 3:	//Y
				cTrans = new ColorTransform(1, 0.86, 0.12, 1, 0, 0, 0, 0);
				break;
			}
			
			
			var scoreStr = Math.floor(_num).toString();
			for (var i:int = scoreStr.length - 1; i >= 0; i--) {
				var temp;
				switch(scoreStr.charAt(i)) {
					case "0":
					temp = new Blockpoint_30_0();
					break;
					case "1":
					temp = new Blockpoint_30_1();
					break;
					case "2":
					temp = new Blockpoint_30_2();
					break;
					case "3":
					temp = new Blockpoint_30_3();
					break;
					case "4":
					temp = new Blockpoint_30_4();
					break;
					case "5":
					temp = new Blockpoint_30_5();
					break;
					case "6":
					temp = new Blockpoint_30_6();
					break;
					case "7":
					temp = new Blockpoint_30_7();
					break;
					case "8":
					temp = new Blockpoint_30_8();
					break;
					case "9":
					temp = new Blockpoint_30_9();
					break;
					
				}
				temp.x = i * 23 - 23 * scoreStr.length / 2;
				temp.mouseEnabled = false;
				
				var temp2 = temp.getChildByName("num");
				
				temp2.transform.colorTransform = cTrans;
				
				
				sub.addChild(temp);
			}
			
		}
		
	}
	
}